<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>

<script>

    /**
     * async函数的执行顺序
    */
    async function fun1() {
        console.log('fun1 begin');
        const result = await fun2();
        console.log('result', result);
        console.log('fun1 end');
    }
    async function fun2() {
        console.log('fun2');
    }
    console.log('script begin');
    fun1();
    console.log('script end');

</script>

</html>